package com.my.hzb.data.mogodb.dao;

import java.util.List;

import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;

import com.my.hzb.data.mogodb.bean.UserBean;
import com.my.hzb.data.mogodb.util.MongoImpl;

@Component
public class UserMongoImpl extends MongoImpl<UserBean> 
	implements UserMongo
{
	public void save(UserBean user){
		this.save(user);
	}
	public List<UserBean> query(UserBean user) {
		return mongoTemplate.find(Query.query(Criteria.where("userName").is(user.getUserName())), UserBean.class);
	}
}
